#include"my_stdio.h"
#include<stdio.h>
#include<string.h>
#include<unistd.h>

int main()
{
  mFILE*fp=mfopen("log.txt","a");
  if(fp==NULL)
  {
    return 1;
  }int cnt=10;
  while(cnt)
  {
    char buffer[64];
    snprintf(buffer,sizeof(buffer),"number is%d\n",cnt);//这里是要\n 前面的头文件里面只写了行刷新的代码
    cnt--;
    mfwrite(buffer,strlen(buffer),fp);
    mfflush(fp);

    sleep(1);
  }
mfclose(fp);
  return 0;
}
